'use strict'

const Service = require('egg').Service

class UserService extends Service {
    // eslint-disable-next-line no-empty-function
    async getUserInfo() {
    // eslint-disable-next-line no-unused-vars
        const userInfo = {
            name: 'vipbic',
            age: '25',
        }
        return userInfo
    }
    // eslint-disable-next-line no-unused-vars
    async find(uid) {
        const user = await this.app.mysql.get('tpt_record', { id: 4 })
        return { user }
    }
    async creat() {
        const obj = {
            ip: '192.168.199.142',
            log_number: 0,
            city: '美国加之哥',
            uuid: '8c922663-b870-a242-37fd-e372b618aa51',
        }
        const data = await this.app.mysql.insert('tpt_record', obj)
        return { data }
    }
    async say() {
        return 'Hello Man!'
    }
}

module.exports = UserService
